<?php $this->load->view("general/header");?>
<div id="about" class="page_">
    <div class="form">            	
        <div class="form_header">FAQ</div>
        <div class="content_data">
            <form method="post" action="<?php echo base_url();?>admin/system/faq">
            	Newer Question will be shown last<br /><br />
                Question: <input type="text" name="question" id="text_question" />
	            <div class="errorField"><?php echo str_replace("The","",str_replace("field","",form_error('question'))); ?></div>
                <br /><br />
                Answer :
	            <div class="errorField"><?php echo str_replace("The","",str_replace("field","",form_error('answer'))); ?></div>
                <br />
                <textarea name="answer" id="elm1" class="elm_textarea" cols="80" rows="10"></textarea>
                <input type="submit" name="btnSave" value="Save" class="button_red" />
            </form>
            <div class="success"><?php echo (isset($success))?$success:"";?></div>
        </div>
        
        <div class="form_header">FAQ List</div>
        <?php if(count($allFAQ) == 0){ ?>
	        <div class="content_data">No FAQ</div>
		<?php }else{ ?>
        	<?php foreach($allFAQ as $faq) { ?>
            	<!-- perulangan -->
                <div class="header_data sub"><a href="answer_<?php echo $faq['id'];?>" alt="hide" class="dropdown_faq"><img src="<?php echo base_url();?>img/arrow_right.png" width="15" height="15" /> <?php echo $faq['question'];?></a> <a href="<?php echo base_url();?>admin/system/delete_faq/<?php echo $faq['id'];?>" onclick="return confirm('Are you sure want to delete this faq?');"><img src="<?php echo base_url();?>img/btndelete.png" title="delete" /></a></div>
                <div class="faq_content_data" id="answer_<?php echo $faq['id'];?>"><?php echo $faq['answer'];?></div>
                <!-- perulangan -->

            <?php } ?>
		<?php }?>
        
    </div>
</div>
<?php $this->load->view("general/footer");?>